﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using AvalonDock;
using System.Windows.Threading;
using RiskMan.Config;
using RiskMan.DataClass.Models;
using RiskMan.DataClass.Models.RM;

namespace RiskMan.Views.LimitMoneyAndDeals
{
    /// <summary>
    /// Логика взаимодействия для LimitMoneyAndDeals.xaml
    /// </summary>
    public partial class LimitMoneyAndDeals : DocumentContent
    {
        private MainWindow mainWindow;
        private DispatcherTimer _dsUpdate;
        private List<PositionModel> positionModel;
        private string _formate;
        VerificationLicense ver = new VerificationLicense();
        public List<String> SeccodeList = new List<String>();


        public LimitMoneyAndDeals()
        {
            mainWindow = RiskMan.MainWindow.StaticRiskMan;
            InitializeComponent();
            this.Title = cfg.MainfunctionLimitmoneyanddeals;

            //positionModel = GetCount(mainWindow._dataProvider.EmitentLimiteList);
            //positionModel.AddRange(GetCount(mainWindow._dataProvider.FortsPositionsList));
        }

        private void button3_Click(object sender, RoutedEventArgs e)
        {

        }

        private void button4_Click(object sender, RoutedEventArgs e)
        {

        }

        private void Button_AddRow_Click(object sender, RoutedEventArgs e)
        {
            LimitMoneyAndDealsModel nlmadItem = new LimitMoneyAndDealsModel();
            NewLimitMoneyAndDeals newlimitMAD = new NewLimitMoneyAndDeals(mainWindow, nlmadItem, mainWindow._dataProvider, false);
            newlimitMAD.ShowDialog();
            mainWindow._dataProvider.LimitMoneyAndDealsList.Add(nlmadItem);

            Update();
        }

        private void button1_Click_1(object sender, RoutedEventArgs e)
        {

        }

        private void button2_Click(object sender, RoutedEventArgs e)
        {
            
        }

        private void LimitMoneyAndDealsViewLayout_Loaded(object sender, RoutedEventArgs e)
        {

        }

        private void Grid_Loaded(object sender, RoutedEventArgs e)
        {

        }

        private void dtgdLimitStock_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {

        }

        private void dtgdLimitStock_MouseUp(object sender, MouseButtonEventArgs e)
        {

        }

        private void dtgdLimitStock_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
        {

        }

        private void dtgdLimitStock_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {

        }

        private void CheckBox_Click(object sender, RoutedEventArgs e)
        {

        }

        public void Update()
        {
            dtgdLimitMoneyAndDeals.ItemsSource = mainWindow._dataProvider.LimitMoneyAndDealsList;

        }
    }
}
